<cfparam name="view" default="organizations" />
<cfparam name="action" default="" />
<cfparam name="alert" default="" />
<cfparam name="email" default="" />
<cfparam name="j_username" default="" />

<cfswitch expression="#action#">
	<cfcase value="emailPassword">
		<cfscript>
			base = new assets.calgrants.com.Base();
			emailResult = base.emailPassword(Email = Email);
		</cfscript>
		<cfif emailResult>
			<cfset alert = "Your password has been sent to #email#" />
			<cfset view = "login" />
		<cfelse>
			<cfset alert = "The e-mail address #email# was not found.  Verify your e-mail address and try again." />
			<cfset view = "password" />
		</cfif>
	</cfcase>
</cfswitch>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Cash for College Workshop Management System</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Cash for College Workshop Management System">
	<meta name="author" content="Syntric">

	<cfoutput>
		<link href="#request.pathToBootstrapCSS#" rel="stylesheet" />
		<link href="#request.pathToKendoCommonCSS#" rel="stylesheet" />
		<link href="#request.pathToKendoDefaultCSS#" rel="stylesheet" />
		<link href="#request.pathToFontAwesomeCSS#" rel="stylesheet" />
		<link href="#request.pathToUI#/common.css" rel="stylesheet" />
		<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel="stylesheet" type="text/css" />
		<script src="#request.pathToJQuery#" type="text/javascript"></script>
		<script src="#request.pathToBootstrap#" type="text/javascript"></script>
		<script src="#request.pathToKendo#" type="text/javascript"></script>
		<script src="#request.pathToUI#/common.js" type="text/javascript"></script>
		<script type="text/javascript">
			<cfif Len(alert) gt 0>
				alert("#alert#");
			</cfif>
			<cfif ArrayLen(request.alerts) gt 0>
				<cfloop index="i" from="1" to="#ArrayLen(request.alerts)#">
					alert("#request.alerts[i]#");
				</cfloop>
			</cfif>
		</script>
	</cfoutput>

</head>

<body style="background-color: white;">

<cfoutput>
	<div class="container-fluid">
		<div class="row-fluid" style="height: 20px;">
			<div class="span12"></div>
		</div>
		<cfswitch expression="#view#">
			<cfcase value="password">
				<div class="row-fluid">
					<div class="span3"></div>
					<div class="span6">
						<img src="common/images/Cash_for_College_logo.gif" width="204" height="54" style="margin-bottom: 8px;">
						<p><strong>Workshop Management System for Regional Adminstrators</strong></p>
						<div class="well well-large" style="width: 370px; margin-bottom: 40px;">
							<cfform id="passwordForm" action="#script_name#" method="post">
								<cfinput type="hidden" name="view" value="#view#" />
								<cfinput type="hidden" name="action" value="emailPassword" />
								<div class="clearfix">
									<label for="email">Enter your e-mail address</label>
									<div class="input-prepend">
										<span class="add-on">
											<i class="icon-envelope"></i>
										</span>
										<cfinput type="text" name="email" value="#email#" style="width: 310px;" required="yes" validate="email" message="E-mail is required and must be a valid e-mail address" />
									</div>
								</div>
								<div class="btn-toolbar clearfix">
									<button type="submit" name="sendPasswordButton" class="btn btn-success">Send Password</button>
									<a href="?view=login" class="btn btn-success">Cancel</a>
								</div>
							</cfform>
						</div>
					</div>
					<div class="span3"></div>
				</div>
			</cfcase>
			<cfdefaultcase>
				<div class="row-fluid">
					<div class="span3"></div>
					<div class="span6">
						<img src="common/images/Cash_for_College_logo.gif" width="204" height="54" style="margin-bottom: 8px;">
						<p><strong>Workshop Management System for Regional Adminstrators</strong></p>
						<div class="well well-large" style="width: 370px; margin-bottom: 40px;">
							<cfform id="loginForm" action="#script_name#" method="post">
								<cfinput type="hidden" name="view" value="#view#" />
								<div class="clearfix">
									<label for="name">E-mail</label>
									<div class="input-prepend">
										<span class="add-on">
											<i class="icon-envelope"></i>
										</span>
										<cfinput type="text" name="j_username" value="#j_username#" style="width: 310px;" required="yes" validate="email" message="E-mail is required and must be a valid e-mail address" />
									</div>
								</div>
								<div class="clearfix">
									<label for="password">Password</label>
									<div class="input-prepend">
										<span class="add-on">
											<i class="icon-lock"></i>
										</span>
										<cfinput type="password" name="j_password" style="width: 310px;" required="yes" message="Password is required" />
									</div>
								</div>
								<div class="btn-toolbar clearfix">
									<input type="submit" name="loginButton" class="btn btn-success" value="Login">
								</div>
							</cfform>
							<div style="margin-top: 10px;">
								<a href="?view=password">Forgot your password?</a>
							</div>
						</div>
					</div>
					<div class="span3"></div>
				</div>
			</cfdefaultcase>
		
		</cfswitch>
		<div class="row-fluid body-row">
			<div class="span3"></div>
			<div class="span6">
				<div style="margin-top: 20px;">
				<small>
				<p><strong>Cash for College</strong> is California's public-private partnership FAFSA completion program administered by the California Student Aid Commission and its regional and local partners.</p>
				<p><strong>Our mission</strong> is to assist high school seniors and recent graduates who are low income or first generation students in accessing as much financial aid as possible. California Cash for College puts California Dreams into Action by helping students complete the Free Application for Federal Student Aid (FAFSA) or California Dream Act Application. Students who apply for financial aid take action to enroll into education beyond high school.</p>
				</small>
				</div>
			</div>
			<div class="span3"></div>
		</div>
	</div>
</cfoutput>

</body>
</html>